<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>{$current['title']}-{$Think.CONFIG.sitename}</title>

    <link href="__PUBLIC__/static/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="__PUBLIC__/static/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/static/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/static/css/animate.min.css" rel="stylesheet">
    <include file="Public/commoncss" />
    <!-- Sweet Alert -->
    <link href="__PUBLIC__/static/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
</head>

<body class="gray-bg top-navigation">
<div id="wrapper">
    <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom white-bg">
            <include file="Public/header" />
        </div>

        <div class="wrapper wrapper-content animated fadeInDown">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>本月报表 <small><?php echo date('y年m月',time()); ?>报</small></h5>
                            <div class="ibox-tools">
                                <button class="btn btn-success btn-xs" type="button" onclick="history.go(-1)">返回上一页</button>
                            </div>
                        </div>
                        <div class="ibox-content">
                          <form action="{:U('update')}" id="myForm">
                            <h3 class="text-center"> <strong>绩效考核表（<?php echo date('Y年m月',time()); ?>）</strong> </h3>
                            <div class="table-responsive">
                                <table class="table table-bordered table-striped">
                                    <thead>
                                    <tr>
                                        <th class="text-center">姓名：</th>
                                        <th class="text-center col-sm-1">{$user.name}</th>
                                        <th class="text-center">部门：</th>
                                        <th class="text-center">技术部</th>
                                        <th class="text-center col-sm-1">所属组：</th>
                                        <th class="text-center">技术部</th>
                                        <th class="text-center">职务：</th>
                                        <th class="text-center" colspan="2">普通员工</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr class="text-center">
                                        <td colspan="1">考核项目</td>
                                        <td>权重</td>
                                        <td colspan="2" >工作详细内容</td>
                                        <td>分项权重</td>
                                        <td>个人评分</td>
                                        <td>经理评分</td>
                                        <td>总监评分</td>
                                        <td>分数</td>
                                    </tr>
                                    <tr >
                                        <td class="text-center col-sm-1" rowspan="2">完成情况</td>
                                        <td rowspan="2" class="text-center">80%</td>
                                        <td class="text-left">例：<br>记录本月工作内容；<br>是否完成本月工作计划；<br>注明本月工作完成质量情况；<br>是否做了本职工作以外的工作；<br>工作技能是否娴熟；<br>团队协作能力；<br>主动学习与工作相关的专业知识；<br>部门及公司会议按时参加；<br>完成领导交付的工作；</td>
                                        <td >
                                            <textarea name="my_assess" id="" cols="30" rows="10" style="resize: none; max-width: 200px;" datatype="*" nullmsg="工作内容不能为空！">{$data.my_assess}</textarea>
                                            <span class="help-block m-b-none Validform_checktip"></span>
                                        </td>
                                        <th rowspan="2" class="text-center"> 100%</th>
                                        <td rowspan="2" class="text-center">
                                            <if condition="$user['type'] eq '0'">

                                                <input name="my_assess_score" id="my_assess_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 200px;border:0px;" value="{$data.my_assess_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.my_assess_score}

                                            </if>
                                        </td>
                                        <td rowspan="2" class="text-center">
                                            <if condition="$user['type'] eq '3'">

                                                <input name="manager_assess_score" id="my_assess_score" datatype="*" nullmsg="不能为空！"  size="10" maxlength="3" style="line-height: 200px;border:0px;" value="{$data.manager_assess_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.manager_assess_score}

                                            </if>

                                        </td>
                                        <td rowspan="2" class="text-center">
                                            <if condition="$user['type'] eq '2'">

                                                <input name="inspector_assess_score" id="my_assess_score" datatype="*" nullmsg="不能为空！"  size="10" maxlength="3" style="line-height: 200px;border:0px;" value="{$data.inspector_assess_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.inspector_assess_score}

                                            </if>
                                        </td>
                                        <td rowspan="2" class="col-sm-1 yellow-bg text-center" style="color: #000;font-weight:900;" id="assessScore">
                                            <if condition="$data['inspector_assess_score']">
                                                {$data.inspector_assess_score|getScore=0.8}
                                                <else/>
                                                <if condition="$data['manager_assess_score']">
                                                    {$data.manager_assess_score|getScore=0.8}
                                                    <else/>
                                                    <if condition="$data['my_assess_score']">
                                                        {$data.my_assess_score|getScore=0.8}
                                                    </if>
                                                </if>
                                            </if>
                                        </td>
                                    </tr>
                                    <tr >
                                        <td class="text-left">管理工作:<br/>（管理人员须填写绩效面谈反馈情况，非管理人员不可填写）</td>
                                        <td class="white-bg">
                                            <textarea name="manager_assess" id="" cols="30" rows="10" style="resize: none; max-width: 200px;max-height: 50px;" >{$data.manager_assess}</textarea>
                                        </td>
                                    </tr>
                                    <tr class="text-center">
                                        <td rowspan="3">工作态度</td>
                                        <td rowspan="3">20%</td>
                                        <td class="text-left">工作责任感</td>

                                        <td class="text-left">
                                            <textarea name="my_duty" id="" cols="30" rows="10" style="resize: none; max-width: 200px;max-height: 50px;" datatype="*" nullmsg="工作责任感不能为空！">{$data.my_duty}</textarea>
                                            <span class="help-block m-b-none Validform_checktip"></span>
                                        </td>
                                        <td>30%</td>
                                        <td>
                                            <if condition="$user['type'] eq '0'">

                                                <input name="my_duty_score" id="my_duty_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.my_duty_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.my_duty_score}

                                            </if>

                                        </td>
                                        <td>
                                            <if condition="$user['type'] eq '3'">

                                                <input name="manager_duty_score" id="my_duty_score" datatype="*" nullmsg="不能为空！"  size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.manager_duty_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.manager_duty_score}

                                            </if>
                                        </td>
                                        <td>
                                            <if condition="$user['type'] eq '2'">

                                                <input name="inspector_duty_score" id="my_duty_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.inspector_duty_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.inspector_duty_score}

                                            </if>
                                        </td>

                                        <td class="yellow-bg" style="color: #000;font-weight:900;" id="dutyScore">
                                            <if condition="$data['inspector_duty_score']">
                                                {$data.inspector_duty_score|getScore=0.06}
                                                <else/>
                                                <if condition="$data['manager_duty_score']">
                                                    {$data.manager_duty_score|getScore=0.06}
                                                    <else/>
                                                    <if condition="$data['my_duty_score']">
                                                        {$data.my_duty_score|getScore=0.06}
                                                    </if>
                                                </if>
                                            </if>
                                        </td>
                                    </tr>
                                    <tr >
                                        <td class="white-bg">主动性、积极性</td>
                                        <td class="white-bg">
                                            <textarea name="my_active" id="" cols="30" rows="10" style="resize: none; max-width: 200px;max-height: 50px;" datatype="*" nullmsg="工作主动、积极性不能为空！">{$data.my_active}</textarea>
                                            <span class="help-block m-b-none Validform_checktip"></span>
                                        </td>
                                        <td class="text-center white-bg">30%</td>
                                        <td class="text-center white-bg">

                                            <if condition="$user['type'] eq '0'">

                                                <input name="my_active_score" id="my_active_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.my_active_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.my_active_score}

                                            </if>

                                        </td>
                                        <td class="text-center white-bg">

                                            <if condition="$user['type'] eq '3'">

                                                <input name="manager_active_score" id="my_active_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.manager_active_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.manager_active_score}

                                            </if>

                                        </td>
                                        <td class="text-center white-bg">

                                            <if condition="$user['type'] eq '2'">

                                                <input name="inspector_active_score" id="my_active_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.inspector_active_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.inspector_active_score}

                                            </if>

                                        </td>
                                        <td class="text-center yellow-bg" style="color: #000;font-weight:900;" id="activeScore">
                                            <if condition="$data['inspector_active_score']">
                                                {$data.inspector_active_score|getScore=0.06}
                                                <else/>
                                                <if condition="$data['manager_active_score']">
                                                    {$data.manager_active_score|getScore=0.06}
                                                    <else/>
                                                    <if condition="$data['my_active_score']">
                                                        {$data.my_active_score|getScore=0.06}
                                                    </if>
                                                </if>
                                            </if>
                                        </td>
                                    </tr>
                                    <tr >
                                        <td class="gray-bg">公司制度遵守情况</td>
                                        <td class="text-left">
                                            <textarea name="my_observe" id="" cols="30" rows="10" style="resize: none; max-width: 200px;max-height: 50px;" datatype="*" nullmsg="公司制度遵守情况不能为空！">{$data.my_observe}</textarea>
                                            <span class="help-block m-b-none Validform_checktip"></span>
                                        </td>
                                        <td class="text-center">40%</td>
                                        <td class="text-center" width="100">

                                            <if condition="$user['type'] eq '0'">

                                                <input name="my_observe_score" id="my_observe_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.my_observe_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.my_observe_score}

                                            </if>

                                        </td>
                                        <td class="text-center" width="100">

                                            <if condition="$user['type'] eq '3'">

                                                <input name="manager_observe_score" id="my_observe_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.manager_observe_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.manager_observe_score}

                                            </if>

                                        </td>
                                        <td class="text-center" width="100">
                                            <if condition="$user['type'] eq '2'">

                                                <input name="inspector_observe_score" id="my_observe_score" datatype="*" nullmsg="不能为空！" size="10" maxlength="3" style="line-height: 50px;border:0px;" value="{$data.inspector_observe_score}" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')">
                                                <span class="help-block m-b-none Validform_checktip"></span>
                                                <else/>

                                                {$data.inspector_observe_score}

                                            </if>
                                        </td>

                                        <td class="text-center yellow-bg" style="color: #000;font-weight:900;" id="observeScore">
                                            <if condition="$data['inspector_observe_score']">
                                                {$data.inspector_observe_score|getScore=0.08}
                                                <else/>
                                                <if condition="$data['manager_observe_score']">
                                                    {$data.manager_observe_score|getScore=0.08}
                                                    <else/>
                                                    <if condition="$data['my_observe_score']">
                                                        {$data.my_observe_score|getScore=0.08}
                                                    </if>
                                                </if>
                                            </if>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="9" >汇报经理填写：</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" >1.通过以上各项的评分，该员工的综合得分是：</td>
                                        <td colspan="7" class="yellow-bg text-center zongfeng" style="color: #000;font-weight:900;">


                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="white-bg">2.您认为该员工应处于的等级是：</td>
                                        <td colspan="7" class="yellow-bg text-center dengji" style="color: #000;font-weight:900;">


                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" >经理评分的理由：</td>
                                        <td colspan="7" >
                                            <if condition="$user['type'] eq '3'">

                                                <textarea name="manager_reason" id="" cols="30" rows="10" style="resize: none;width: 100%; max-height: 50px;">{$data.manager_reason}</textarea>

                                                <else/>

                                                {$data.manager_reason}
                                            </if>

                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="white-bg">总监评分的理由：</td>
                                        <td colspan="7" class="white-bg">
                                            <if condition="$user['type'] eq '2'">

                                                <textarea name="inspector_reason" id="" cols="30" rows="10" style="resize: none;width: 100%; max-height: 50px;">{$data.inspector_reason}</textarea>

                                                <else/>

                                                {$data.inspector_reason}
                                            </if>
                                        </td>
                                    </tr>
                                    <tr class="gray-bg">
                                        <td colspan="9" >最终评定：</td>
                                    </tr>
                                    <tr>
                                        <td class="white-bg">评分等级</td>
                                        <td class="text-center yellow-bg dengji" style="color: #000;font-weight:900;"></td>
                                        <td class="white-bg">评定系数：</td>
                                        <td class="text-center yellow-bg" id="jixiao" style="color: #000;font-weight:900;">

                                        </td>
                                        <td colspan="5" class="white-bg"></td>
                                    </tr>
                                    <if condition="($data['status'] eq 2) OR ($data['status'] eq 3)">
                                        <tr>
                                            <td class="white-bg text-center" colspan="9">
                                                {$data.status|getMonthlyStatus}
                                            </td>
                                        </tr>
                                        <else/>
                                        <tr>
                                            <td class="white-bg text-center" colspan="9">
                                                <input type="hidden" name="id" value="{$data.id}">
                                                <input type="hidden" name="aggregate" value="{$data.aggregate}">
                                                <input type="hidden" name="status" value="1">
                                                <button class="btn btn-primary" type="submit">保存内容</button>
                                                <p id="dump"></p>
                                            </td>
                                        </tr>
                                    </if>
                                    </tbody>
                                </table>
                            </div>
                          </form>
                        </div>
                    </div>
                </div>

            </div>
            
        </div>
        <include file="Public/footer" />
   </div>
</div>
<!--等级评分0<D<=60,60<C<=90,90<B<=100,100<A-->
<!--系数评分D=0.0,C=1.0,B=1.5,A=2.0-->
<include file="Public/commonjs" />
<script src="__PUBLIC__/static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__PUBLIC__/static/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/static/js/plugins/iCheck/icheck.min.js"></script>
<script src="__PUBLIC__/static/js/plugins/validate/Validform_v5.3.2.js"></script>
<script src="__PUBLIC__/static/js/plugins/sweetalert/sweetalert.min.js"></script>
<if condition="($data['status'] eq 2) OR ($data['status'] eq 3)">
    <script>
        $(document).ready(function(){
            var assessScore = parseFloat($("#assessScore").html());
            var dutyScore = parseFloat($("#dutyScore").html());
            var activeScore = parseFloat($("#activeScore").html());
            var observeScore = parseFloat($("#observeScore").html());
            var aggregate = (assessScore+dutyScore+activeScore+observeScore).toFixed(2);
            $('.zongfeng').html(aggregate);
            $(".dengji").html(getLevel(aggregate));
            $("#jixiao").html(getPerformance(aggregate));
        });
    </script>
    <else/>
    <script>
        $(document).ready(function(){
                $("#my_assess_score").on("blur",function(){
                    $("#assessScore").html(($("#my_assess_score").val()*0.8).toFixed(2));
                });
                $("#my_duty_score").on("blur",function(){
                    $("#dutyScore").html(($("#my_duty_score").val()*0.3*0.2).toFixed(2));
                });
                $("#my_active_score").on("blur",function(){
                    $("#activeScore").html(($("#my_active_score").val()*0.3*0.2).toFixed(2));
                });
                $("#my_observe_score").on("blur",function(){
                    $("#observeScore").html(($("#my_observe_score").val()*0.2*0.4).toFixed(2));
                });
            $('body').bind('click', function(event) {
                var assessScore = parseFloat($("#assessScore").html());
                var dutyScore = parseFloat($("#dutyScore").html());
                var activeScore = parseFloat($("#activeScore").html());
                var observeScore = parseFloat($("#observeScore").html());
                var aggregate = (assessScore+dutyScore+activeScore+observeScore).toFixed(2);
                $("input[name='aggregate']").val(aggregate);
            });
            //提交表单
            $("#myForm").Validform({
                tiptype:function(msg,o,cssctl){
                    if(!o.obj.is("form")){
                        if(o.type !=2){
                            var objtip=o.obj.siblings(".Validform_checktip");
                            cssctl(objtip,o.type);
                            objtip.text(msg);
                        }
                    }else{
                        if(msg == '恭喜,操作成功！'){
                            window.location.href="{:U('Monthly/index')}";
                        }else{
                            swal(msg);
                        }
                    }
                },
                ajaxPost:true,
            });
        });
    </script>
</if>
</body>

</html>